package cn.lix.sc.rpc.server.service.impl;

import cn.lix.sc.rpc.impl.common.annotations.RpcService;
import cn.lix.sc.rpc.impl.common.exception.BizException;
import cn.lix.sc.rpc.service.demo.dto.User;
import cn.lix.sc.rpc.service.demo.service.TestService;
import cn.lix.sc.rpc.service.demo.service2.TestService2;

@RpcService
public class TestServiceImpl implements TestService, TestService2 {

    private final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass());

    @Override
    public User hello(Integer a, String name, Boolean test) {
        return new User(a, name, test);
    }

    @Override
    public String hello(int a, String name, Boolean test) {
        return "TestService2.hello";
    }

    @Override
    public String hello2(User user) {
        return user.toString();
    }

    @Override
    public void hello3() {
        log.error("hello3");
        throw BizException.error("test");
    }
}
